package com.yuyou.tas.util.bean;

import org.apache.commons.lang3.StringUtils;

public class ResBoolSimpleInfo<T> {

	private boolean success;	
	private String message;
	private T data;


	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	private static ResBoolSimpleInfo<String> successInfo=new ResBoolSimpleInfo<String>(true,null,StringUtils.EMPTY);
	
	public static ResBoolSimpleInfo<String> getSuccessInfo(){
		return successInfo;
	}
	
	public static ResBoolSimpleInfo<String> getFailInfo(String message){
		ResBoolSimpleInfo<String> res=new ResBoolSimpleInfo<String>();
		res.setMessage(message);
		res.setSuccess(false);
		return res;
		
	}
	
	public ResBoolSimpleInfo(){

	}
	
	@SuppressWarnings("unchecked")
	public ResBoolSimpleInfo(boolean success,String message){
		this.success=success;
		this.message=message;
		this.data=(T)StringUtils.EMPTY;
	}

	public ResBoolSimpleInfo(boolean success,String message, T data){
		this.success = success;
		this.message = message;
		this.data = data;
	}
	
	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
}
